﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SimpleExampleCharacterProperties
{
    private CharacterPropertiesGroup propertiesGroup;
    private Dictionary<string,GameProperty> properties;
    public Dictionary<string,IBuffBase> Buffs;


    public GameProperty GetProperty(string id)
    {
        if(properties.ContainsKey(id))
        {
            return properties[id];
        }
        else
        {
            Debug.LogError("属性列表中不存在属性，属性ID为："+id);
            return null;
        }
    }


    private void SetProperties()
    {
        HPPropertyFactory hPPropertyFactory = new HPPropertyFactory(propertiesGroup.Hero);

        var hp = hPPropertyFactory.GamePropertyCreator();
        var atk = new GameProperty(10,25,10);

        properties.Add("HP",hp);
        properties.Add("atk",atk);
    }


    public SimpleExampleCharacterProperties(CharacterPropertiesGroup propertiesGroup)
    {
        properties = new Dictionary<string, GameProperty>();
        Buffs = new Dictionary<string, IBuffBase>();

        this.propertiesGroup = propertiesGroup;
        SetProperties();
    }
}

public struct CharacterPropertiesGroup
{
    public GameObject Hero;
}
